/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 */

import { BuildNativeWithCmake } from '../../build-native-with-cmake.js';
import { TaskNames } from '../../common/task-names.js';
import { ModuleTaskService } from '../../service/module-task-service.js';
import { TargetTaskService } from '../../service/target-task-service.js';
import { AbstractModuleHookTask } from '../abstract-module-hook-task.js';
import CommonHookTask = TaskNames.CommonHookTask;

/**
 * 暴露给其他模块使用的hook任务,任务名不可更改
 *
 * @since 2022/5/13
 */
export class CompileNativeHook extends AbstractModuleHookTask {
  constructor(moduleService: ModuleTaskService) {
    super(moduleService, true, CommonHookTask.COMPILE_NATIVE);
  }

  initTaskDepends(taskTargetService: TargetTaskService) {
    this.dependsOn(`${taskTargetService.getTargetData().getTargetName()}@${BuildNativeWithCmake.name}`);
  }
}
